import 'dart:convert';

KLineBeanEntity kLineBeanEntityFromJson(String str) => KLineBeanEntity.fromJson(json.decode(str));

String kLineBeanEntityToJson(KLineBeanEntity data) => json.encode(data.toJson());

class KLineBeanEntity {
  String? symbol;
  String? digits;
  String? datetime;
  String? datetimeMsc;
  String? bid;
  String? bidLow;
  String? bidHigh;
  String? bidDir;
  String? ask;
  String? askLow;
  String? askHigh;
  String? askDir;
  String? last;
  String? lastLow;
  String? lastHigh;
  String? lastDir;
  String? volume;
  String? volumeReal;
  String? volumeLow;
  String? volumeLowReal;
  String? volumeHigh;
  String? volumeHighReal;
  String? volumeDir;
  String? tradeDeals;
  String? tradeVolume;
  String? tradeVolumeReal;
  String? tradeTurnover;
  String? tradeInterest;
  String? tradeBuyOrders;
  String? tradeBuyVolume;
  String? tradeBuyVolumeReal;
  String? tradeSellOrders;
  String? tradeSellVolume;
  String? tradeSellVolumeReal;
  String? priceAw;
  String? priceOpen;
  String? priceClose;
  String? priceChange;
  String? priceVolatility;
  String? priceTheoretical;
  String? priceGreeksDelta;
  String? priceGreeksTheta;
  String? priceGreeksGamma;
  String? priceGreeksVega;
  String? priceGreeksRho;
  String? priceGreeksOmega;
  String? priceSensitivity;
  String? rateDay;
  double? rateDiffPrice;

  KLineBeanEntity({
    required this.symbol,
    required this.digits,
    required this.datetime,
    required this.datetimeMsc,
    required this.bid,
    required this.bidLow,
    required this.bidHigh,
    required this.bidDir,
    required this.ask,
    required this.askLow,
    required this.askHigh,
    required this.askDir,
    required this.last,
    required this.lastLow,
    required this.lastHigh,
    required this.lastDir,
    required this.volume,
    required this.volumeReal,
    required this.volumeLow,
    required this.volumeLowReal,
    required this.volumeHigh,
    required this.volumeHighReal,
    required this.volumeDir,
    required this.tradeDeals,
    required this.tradeVolume,
    required this.tradeVolumeReal,
    required this.tradeTurnover,
    required this.tradeInterest,
    required this.tradeBuyOrders,
    required this.tradeBuyVolume,
    required this.tradeBuyVolumeReal,
    required this.tradeSellOrders,
    required this.tradeSellVolume,
    required this.tradeSellVolumeReal,
    required this.priceAw,
    required this.priceOpen,
    required this.priceClose,
    required this.priceChange,
    required this.priceVolatility,
    required this.priceTheoretical,
    required this.priceGreeksDelta,
    required this.priceGreeksTheta,
    required this.priceGreeksGamma,
    required this.priceGreeksVega,
    required this.priceGreeksRho,
    required this.priceGreeksOmega,
    required this.priceSensitivity,
    required this.rateDay,
    required this.rateDiffPrice,
  });

  factory KLineBeanEntity.fromJson(Map<String, dynamic> json) => KLineBeanEntity(
    symbol: json["Symbol"],
    digits: json["Digits"],
    datetime: json["Datetime"],
    datetimeMsc: json["DatetimeMsc"],
    bid: json["Bid"],
    bidLow: json["BidLow"],
    bidHigh: json["BidHigh"],
    bidDir: json["BidDir"],
    ask: json["Ask"],
    askLow: json["AskLow"],
    askHigh: json["AskHigh"],
    askDir: json["AskDir"],
    last: json["Last"],
    lastLow: json["LastLow"],
    lastHigh: json["LastHigh"],
    lastDir: json["LastDir"],
    volume: json["Volume"],
    volumeReal: json["VolumeReal"],
    volumeLow: json["VolumeLow"],
    volumeLowReal: json["VolumeLowReal"],
    volumeHigh: json["VolumeHigh"],
    volumeHighReal: json["VolumeHighReal"],
    volumeDir: json["VolumeDir"],
    tradeDeals: json["TradeDeals"],
    tradeVolume: json["TradeVolume"],
    tradeVolumeReal: json["TradeVolumeReal"],
    tradeTurnover: json["TradeTurnover"],
    tradeInterest: json["TradeInterest"],
    tradeBuyOrders: json["TradeBuyOrders"],
    tradeBuyVolume: json["TradeBuyVolume"],
    tradeBuyVolumeReal: json["TradeBuyVolumeReal"],
    tradeSellOrders: json["TradeSellOrders"],
    tradeSellVolume: json["TradeSellVolume"],
    tradeSellVolumeReal: json["TradeSellVolumeReal"],
    priceAw: json["PriceAw"],
    priceOpen: json["PriceOpen"],
    priceClose: json["PriceClose"],
    priceChange: json["PriceChange"],
    priceVolatility: json["PriceVolatility"],
    priceTheoretical: json["PriceTheoretical"],
    priceGreeksDelta: json["PriceGreeksDelta"],
    priceGreeksTheta: json["PriceGreeksTheta"],
    priceGreeksGamma: json["PriceGreeksGamma"],
    priceGreeksVega: json["PriceGreeksVega"],
    priceGreeksRho: json["PriceGreeksRho"],
    priceGreeksOmega: json["PriceGreeksOmega"],
    priceSensitivity: json["PriceSensitivity"],
    rateDay: json["rate_day"]?.toString(),
    rateDiffPrice: json["rate_diff_price"]?.toDouble(),
  );

  Map<String, dynamic> toJson() => {
    "Symbol": symbol,
    "Digits": digits,
    "Datetime": datetime,
    "DatetimeMsc": datetimeMsc,
    "Bid": bid,
    "BidLow": bidLow,
    "BidHigh": bidHigh,
    "BidDir": bidDir,
    "Ask": ask,
    "AskLow": askLow,
    "AskHigh": askHigh,
    "AskDir": askDir,
    "Last": last,
    "LastLow": lastLow,
    "LastHigh": lastHigh,
    "LastDir": lastDir,
    "Volume": volume,
    "VolumeReal": volumeReal,
    "VolumeLow": volumeLow,
    "VolumeLowReal": volumeLowReal,
    "VolumeHigh": volumeHigh,
    "VolumeHighReal": volumeHighReal,
    "VolumeDir": volumeDir,
    "TradeDeals": tradeDeals,
    "TradeVolume": tradeVolume,
    "TradeVolumeReal": tradeVolumeReal,
    "TradeTurnover": tradeTurnover,
    "TradeInterest": tradeInterest,
    "TradeBuyOrders": tradeBuyOrders,
    "TradeBuyVolume": tradeBuyVolume,
    "TradeBuyVolumeReal": tradeBuyVolumeReal,
    "TradeSellOrders": tradeSellOrders,
    "TradeSellVolume": tradeSellVolume,
    "TradeSellVolumeReal": tradeSellVolumeReal,
    "PriceAw": priceAw,
    "PriceOpen": priceOpen,
    "PriceClose": priceClose,
    "PriceChange": priceChange,
    "PriceVolatility": priceVolatility,
    "PriceTheoretical": priceTheoretical,
    "PriceGreeksDelta": priceGreeksDelta,
    "PriceGreeksTheta": priceGreeksTheta,
    "PriceGreeksGamma": priceGreeksGamma,
    "PriceGreeksVega": priceGreeksVega,
    "PriceGreeksRho": priceGreeksRho,
    "PriceGreeksOmega": priceGreeksOmega,
    "PriceSensitivity": priceSensitivity,
  };
}
